package com.baizhi.service2;

import com.baizhi.entrty.Guru;
import com.baizhi.service.GuruService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class GuruService2Impl implements GuruService2 {
    @Autowired
    private GuruService gs;
    @Override
    public Map insert(Guru gu) {
        Map map = new HashMap();

        try {
            gs.insert(gu);
            map.put("myinsertg",true);
        } catch (Exception e) {
            map.put("myinsertg",false);
            e.printStackTrace();
        }
        return map;
    }

    @Override
    public Map dj(int[] id) {
        Map map = new HashMap();

        try {
            gs.dj(id);
            map.put("mydjgg",true);
        } catch (Exception e) {
            map.put("mydjgg",false);
            e.printStackTrace();
        }
        return map;
    }

    @Override
    public Map jd(int[] id) {
        Map map = new HashMap();

        try {
            gs.jd(id);
            map.put("myjdgg",true);
        } catch (Exception e) {
            map.put("myjdgg",false);
            e.printStackTrace();
        }
        return map;
    }
}
